package megrez.oss.minio.web.vo;

import java.util.Date;

import io.minio.messages.Bucket;
import lombok.Data;

/**
 * 桶
 *  
 * @author Lucky Yang
 * @since 2.6.9
 */
@Data
public class BucketVO {
    private String name;
    private Date creationDate;

    public static BucketVO of(Bucket bucket) {
        BucketVO rslt = new BucketVO();
        rslt.setName(bucket.name());
        rslt.setCreationDate(Date.from(bucket.creationDate().toInstant()));
        return rslt;
    }
}
